﻿@model CmsMedia
@{
    ResFile = "cms_Media";
}
<fieldset class="b-form">
@using (Html.BeginForm(Model.IsNew ? "add" : "edit", "cmsmedia", FormMethod.Post, new { id = "addNewMediaFolder"}))
{
    <ol class="b-form__rows ul-reset g-clear">
        <li class="b-form__row g-clear">
            <label for="FolderName">@_("Media name")</label>
            @Html.TextBoxFor(p => p.FolderName, new { @class = "text" })
            @Html.ValidationMessageFor(p => p.FolderName)
        </li>
        <li class="b-form__row g-clear">
            <label for="Description">@_("Description")</label>
            @Html.TextAreaFor(p => p.Description, new { @class = "text textarea" })
            @Html.ValidationMessageFor(p => p.Description)
        </li>
        <li class="b-form__row g-clear">
            <label for="ParentMediaId">@_("Parent folder")</label>
            @Html.DropDownListFor(p => p.ParentMediaId, (SelectList)ViewBag.Folders, _("Top Level"))
            @Html.ValidationMessageFor(p => p.Description)
        </li>
        @(Html.UserGroupPlaceholder().ForUserGroups(PredefinedUserGroups.Developer).Template(
                @<text>
                    <li class="b-form__row g-clear">
                        <label>@_("Media scope")<br/><span style="color: red">@_("(for the item and all subitems!)")</span></label>
                        @Html.Partial("SiteAwarePlug", Model)
                    </li>
                </text>)
                .AlternativeTemplate(
                @<text>
                    <li class="b-form__row g-clear" style="display:none">                        
                        @Html.Partial("SiteAwarePlug", Model)
                    </li>
                </text>)
                .Render())
        @if (!Model.IsNew)
        { 
        <li class="b-form__row g-clear">
            @Html.HiddenFor(p => p.Id)            
        </li>
        }
	    <li class="b-form__row b-form__row_buttons g-clear">            
	        <input class="b-button" id="Save" name="Save" type="submit" value="@_("Save")" />
	        @if (!Model.IsNew)
	        {
	            <input class="b-button b-button_colour_grey" id="Delete" name="Delete" type="submit" value="@_("Delete folder with all contents")" />             	    
	        }
	        
	    </li>
    </ol>
}	
</fieldset>